import request from '@/utils/request'

export default {
	/**
	 * @method用户扫商家码支付
	 */
	offlineOrderPay(data) {
		return request({
			url: `/ws/offlineOrder/pay`,
			method: "get",
			data
		});
	},

	/**
	 * @method商家生成收款码
	 */
	offlineOrderQrCode(data) {
		return request({
			url: `/ws/offlineOrder/qrCode`,
			method: "get",
			data
		});
	},

	/**
	 * @method领取打赏提交
	 */
	addReward(data) {
		return request({
			url: `/reward/api/addReward`,
			method: 'post',
			data
		})
	},

	/**
	 * @method获取打赏列表
	 */
	rewardBusinessList(data) {
		return request({
			url: `/reward/api/rewardBusinessList`,
			method: 'get',
			data
		})
	},

	/**
	 * @method获取打赏详细信息
	 */
	getRewardInfoById(id) {
		return request({
			url: `/reward/api/getRewardInfoById/${id}`,
			method: 'get',
		})
	},
	/**
	 * @method商户审核打赏
	 */
	verifyReward(data) {
		return request({
			url: `/reward/api/verifyReward`,
			method: 'get',
			data
		})
	},

	//店铺支付
	apppaybond(data) {
		return request({
			url: `/mall/stores/apppaybond/${data.payment}/${data.platform}`,
			method: 'get',
		})
	},

	// 店铺新增
	addStores(data) {
		return request({
			url: `/ws/mallStore/addStore`,
			method: 'post',
			data: data,
		})
	},
	// 商品订单修改
	sp_ordersEdit(params) {
		return request({
			url: `/mall/productOrders/appEdit`,
			method: 'PUT',
			data: params
		})
	},
	
	// 商家 发货
	mallOrderSend(params) {
		return request({
			url: `/ws/mallOrder/send`,
			method: 'get',
			data: params
		})
	},
	
	// 商家 修改物流单号
	updatelogistics(params) {
		return request({
			url: `/ws/mallOrder/update/logistics`,
			method: 'get',
			data: params
		})
	},
	
	// 查询物流信息
	mallOrderLogistics(query) {
	  return request({
	    url: "/logistics/logisticsInfo",
	    method: "get",
	    data: query,
	  })
	},

	//店铺订单列表
	ordersList(params) {
		return request({
			url: `/ws/mallOrder/business/order/list`,
			method: 'get',
			data: params
		})
	},

	// 查询分类的属性名列表
	getSpecGroupByType() {
		return request({
			url: '/ws/mallSpec/list',
			method: 'get',
		})
	},

	// 新增商品
	addProductsSpu(data) {
		return request({
			url: '/ws/mallSpu/add',
			method: 'post',
			data: data
		})
	},

	// 商品基本属性修改
	amendCommodity(data) {
		return request({
			url: `/ws/mallSpu/edit`,
			method: 'post',
			data
		})
	},

	// 修改店铺商品状态
	productsSpuEditSku(data) {
		return request({
			url: `/mall/productsSpu`,
			method: 'put',
			data: data
		})
	},

	// 商品上架 
	mallSpuvalid(data) {
		return request({
			url: `/ws/mallSpu/valid`,
			method: 'post',
			data: data
		})
	},

	// 查询自己的店铺
	appgetstores(data) {
		return request({
			url: `/ws/mallStore/user/store`,
			method: 'get',
		})
	},

	// 查询商品列表 ---店铺
	appstoresList(params) {
		return request({
			url: `/ws/mallSpu/user/mallSpuList`,
			method: 'get',
			data: params
		})
	},

	// 商品订单修改 商家核销
	editExpres(params) {
		return request({
			url: `/mall/productOrders/editExpres`,
			method: 'PUT',
			data: params
		})
	},

	//店铺营业
	appeditstores(data) {
		return request({
			url: `/mall/stores/app/editstores`,
			method: 'put',
			data: data
		})
	},

	//店铺--统计
	storesStatistics(data) {
		return request({
			url: `/ws/mallOrder/business/order/statistics`,
			method: 'get',
			data: data
		})
	},
}